import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'IndexView',
      component: () => import('@/views/IndexView.vue'),
      children:[
        {
          path:'/',
          redirect: 'home'
        },
        {
          path: 'home',
          name: 'HomePage',
          component: () => import('@/views/HomePage.vue'),
        },
        {
          path: 'appoint',
          name: 'AppointView',
          component: () => import('@/views/AppointView.vue'),
        },
        {
          path: 'dialogue',
          name: 'DialogueView',
          component: () => import('@/views/DialogueView.vue'),
        },
        {
          path: 'drug',
          name: 'DrugView',
          component: () => import('@/views/DrugView.vue'),
        },
        {
          path: 'personage',
          name: 'PersonageView',
          component: () => import('@/views/PersonageView.vue'),
        },
      ]
    },
    {
      path: '/login',
      name: 'LoginView',
      component: () => import('@/views/LoginView.vue'),
    }
  ],
})

export default router
